package com.orangelife.mobile.web;

import com.curry.android.util.StringUtil;
import com.orangelife.mobile.constants.WebViewURL;
import com.orangelife.mobile.util.UriUtil;

/**
 * <p/>
 * Created by 吴格非 on 2016-8-24.
 * <p/>
 *
 * @author 吴格非
 * @since v1.0.0
 */
public class TitleBarUtil {

    /** 特殊URL的特殊处理 */
    public static void handleTitleBar(String path, WebHandler handler) {
        if (!StringUtil.isBlank(path)) {
            if (path.contains(WebViewURL.SIGN_IN)) {
                interceptSignGuide(path, handler);
            }
        }
    }

    /** 签到引导 */
    public static void interceptSignGuide(String path, WebHandler handler) {
        String isFirstTime = UriUtil.getValue(path, "isonetime");
        if ("1".equals(isFirstTime)) {/*如果第一次进入签到界面，则隐藏标题栏，全屏，因为引导层是全屏的*/
            handler.obtainMessage(WebWhat.HIDE_TILTE).sendToTarget();
        }
    }

}
